package com.nunbey.lingxi.lincat.dialog;

import android.app.AlertDialog;
import android.content.Context;

public class AlertDialogCreator extends AlertDialog {

    protected AlertDialogCreator(Context context) {
        super(context);
    }

    /**
     * @author lincat
     * @description get one confirmDialog
     * @param context
     * @param tittle
     * @param content
     * @param confirm
     * @param onClickListener
     * @return
     */
    public static AlertDialog getConfirmDialog(Context context, String tittle, String content, String confirm, OnClickListener onClickListener){
        AlertDialog.Builder builder = new AlertDialog.Builder(context)
                .setTitle(tittle)
                .setMessage(content)
                .setCancelable(false)
                .setPositiveButton(confirm,onClickListener);
        return  builder.create();
    }

    /**
     * @author lincat
     * @description 获得询问对话框
     * @param context
     * @param tittle
     * @param content
     * @param okText
     * @param okOnClickListener
     * @param refuseText
     * @param refuseOnClickListener
     * @return
     */
    public static AlertDialog getQueryDialog(Context context, String tittle, String content, String okText, OnClickListener okOnClickListener,String refuseText,OnClickListener refuseOnClickListener){
        AlertDialog.Builder builder = new AlertDialog.Builder(context)
                .setTitle(tittle)
                .setMessage(content)
                .setCancelable(false)
                .setPositiveButton(okText,okOnClickListener)
                .setNegativeButton(refuseText,refuseOnClickListener);
        return  builder.create();
    }




}
